<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>选项卡</title>
		<style>
			button{
				background-color: #dfdfdf;
				padding: 5px 10px;
				width: 100px;
				height: 50px;
			}
			div{
				width: 500px;
				height: 450px;
				text-align: center;
				line-height: 220px;
				background-color: #aaaa7f;
				display: none;
			}
			#btn1{
				background-color: #dfdfdf;
			}
			.d1{
				display: block;
			}
		</style>
		<script src="../js/jquery-1.11.1.js"></script>
	</head>
	<body>
		<button id="btn1">选项1</button>
		<button id="btn2">选项2</button>
		<button id="btn3">选项3</button>
		<div class="d1">文字内容一</div>
		<div class="d2">文字内容二</div>
		<div class="d3">文字内容三</div>
	</body>
	<script>
		$("#btn1").click(function(){
			$(".d1").show();
			$(".d2").hide();
			$(".d3").hide();
			$("#btn1").css("background-color","#aaaaff");
			$("#btn2").css("background-color","#dfdfdf");
			$("#btn3").css("background-color","#dfdfdf");
		});
		$("#btn2").click(function(){
			$(".d1").hide();
			$(".d2").show();
			$(".d3").hide();
			$("#btn1").css("background-color","#dfdfdf");
			$("#btn2").css("background-color","#55aa00");
			$("#btn3").css("background-color","#dfdfdf");
		});
		$("#btn3").click(function(){
			$(".d1").hide();
			$(".d2").hide();
			$(".d3").show();
			$("#btn1").css("background-color","#dfdfdf");
			$("#btn2").css("background-color","#dfdfdf");
			$("#btn3").css("background-color","#00007f");
		});
	</script>
</html>